// components/rent/rent.component.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    currentChoose: {
      type: Number
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    items: [
      {
        id: 1,
        title: '不限',
        value: '0'
      },
      {
        id: 2,
        title: '600以下',
        value: 'price < 600'
      },
      {
        id: 3,
        title: '600 - 800',
        value: 'price > 600 and price <= 800'
      },
      {
        id: 4,
        title: '800 - 1000',
        value: 'price > 800 and price <= 1000'
      },
      {
        id: 5,
        title: '1000 - 1200',
        value: 'price > 1000 and price <= 1200'
      },
      {
        id: 6,
        title: '1200 - 1400',
        value: 'price > 1200 and price <= 1400'
      },
      {
        id: 7,
        title: '1400以上',
        value: 'price > 1400'
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    bindCode: function (e) {
      var wherePrice = {
        price: e.target.dataset.value,
        currentFilterId: 0,
        currentChoose: e.target.dataset.id
      }
      this.triggerEvent('priceEvent', wherePrice) //myevent自定义名称事件，父组件中使用
    }
  }
})
